package com.lengyu.vxminiprogram.schedules;

import com.lengyu.vxminiprogram.iot.LengyuIotUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class InitFormSchedule {
    private final static Logger logger = LoggerFactory.getLogger(InitFormSchedule.class);

    @Autowired
    LengyuIotUtil lengyuIotUtil;

    /**
     * 每天凌晨12点5分开始初期化当天数据
     * @throws InterruptedException
     */
//    @Scheduled(cron = "0 20 0 * * ? ")
    @Scheduled(fixedDelay = 1000 * 60 * 60*6)
    public void  initFormEveryDay()  {
//        lengyuIotUtil.getToken();
//        JSONObject params = new JSONObject();
//        params.put("product_id","8cb31f7297753c0c711a586fe4711855");
//        lengyuIotUtil.getTagsArray(params);
//
//        JSONObject params1 = new JSONObject();
//        lengyuIotUtil.getTagHistoryDataForEchartCompare(params1);
//        logger.info("每日初期化数据结束");
//        logger.info(JSONObject.toJSONString(result));
    }


}
